Token导航 LogoToken导航

Agent Skill · 开发

token-optimizer(令牌优化器)

token-optimizer 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

token-optimizer 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有未通过项,按安装量在开发类的 21,746 个 Skill 里排第 19,239。

总安装 285周安装 12GitHub Stars 20下载 309核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:token-optimizer(令牌优化器)
来源仓库:https://github.com/georgekhananaev/claude-skills-vault
仓库路径:skills/token-optimizer
安装命令:
npx skills add https://github.com/georgekhananaev/claude-skills-vault --skill token-optimizer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/georgekhananaev/claude-skills-vault --skill token-optimizer

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

token-optimizer 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。可结合来源仓库和原始 README 核验具体用法,通过 npx 命令安装。

安装前建议确认权限范围、维护状态及是否会触发联网或文件操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/token-optimizer

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/georgekhananaev/claude-skills-vault --skill to…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

token-optimizer 怎么安装?

在终端执行 npx skills add https://github.com/georgekhananaev/claude-skills-vault --skill token-optimi…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

token-optimizer 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

token-optimizer 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/georgekhananaev/claude-skills-vault --skill token-optimizer 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

token-optimizer 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

token-optimizer 用的人多吗?

公开数据是累计安装 285 次,近一周安装 12 次,下载 309 次,GitHub 20 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

token-optimizer 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
token-optimizer

令牌优化器 · 本页

28520执行命令未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Token Optimizer

Reduce tokens in prompts, docs, and prose while preserving meaning.

When to Use

  • Prompt >1500 tokens or contains redundant phrasing
  • Docs/markdown need compression for LLM context
  • Writing prose for humans (docs, commits, PRs, error messages)
  • Converting JSON/YAML/XML data for LLM input (TOON)

Quick Routing

Input TypeGo To
User prompt / chat messageSection 1: Prompt Compression
Docs / markdown / READMESection 2: Doc Formatting
Commits / PRs / error messagesSection 3: Prose Clarity
JSON / YAML / XML dataSection 4: TOON Format

Compression Levels

LevelReductionUse When
Light20-30%Keep readability, human-facing prose
Medium40-50%Default for LLM context
Heavy60-70%Max compression, symbols over words

1. Prompt Compression

Process

  1. Identify core intent
  2. Extract essential context only
  3. Remove filler phrases
  4. Apply abbreviations & symbols
  5. Output compressed version w/ token savings %

Remove Phrases

RemoveTransform To
"Please help me with"(delete)
"I need you to"(delete)
"Could you please"(delete)
"I would like to"(delete)
"I think", "Maybe", "Perhaps"(delete)
"This might be a dumb question"(delete)
"For your reference"(delete)
"As I mentioned before"(delete)

Transform Patterns

VerboseCompressed
"I want to create a fn that takes X and returns Y"fn(X) -> Y
"The error message says..."Error:...
"In the file located at..."File:...
"I'm trying to..."Goal:...
"Here is my code..."Code:
"The problem is that..."Issue:...

Example

Before (847 tokens):

Hello! I hope you're doing well. I was wondering if you could help me.
I'm trying to build a React app and I need a custom hook that fetches
user data from /api/users. It returns JSON. I'd like loading, error
states, and caching. I think useEffect and useState but not sure...

After (156 tokens):

Goal: React hook for user data fetching
- Endpoint: /api/users -> JSON user obj
- Handle: loading, error states
- Cache response
Stack: React (useEffect, useState)

2. Doc Formatting

Remove Filler Words

Remove when possible: "basically", "essentially", "actually", "really"

VerboseCompressed
"in order to""to"
"due to the fact that""because"
"at this point in time""now"
"in the event that""if"
"has the ability to""can"
"it is important to note that"(remove)

Compress Lists

Before:

The following features are included:
- User authentication with JWT tokens
- Role-based access control for authorization
- Password hashing using bcrypt algorithm

After:

Features:
- JWT auth
- RBAC authz
- bcrypt passwords

Structured Data Over Prose

Before:

The API accepts three parameters. The first is "userId" which is a
required string. The second is "limit", optional number, defaults to 10.

After:

Params:
- userId: str (req) - user ID
- limit: num (opt, def=10)

Heading Compression

Before: # Comprehensive Guide to User Authentication and Authorization After: # Auth Guide

Table Compression

Shorten column headers, use abbreviations in cells:

ParamTypeReqDefDesc
userIdstrY-user ID
limitnumN10max results

Code Block Compression

Remove comments that restate the code. Collapse trivial logic:

Before:

// Check if email is valid
const isEmailValid = emailRegex.test(email);
// Check if password is at least 8 characters
const isPasswordValid = password.length >= 8;
// Return true if both are valid
return isEmailValid && isPasswordValid;

After:

return emailRegex.test(email) && password.length >= 8;

URL & Path Compression

Replace full home paths: /Users/username/Documents/Projects/MyApp/config/settings.json -> ~/Projects/MyApp/config/settings.json

Error Message Compression

Keep error codes and stack traces exact. Compress surrounding prose: Err: Invalid/expired token. Re-authenticate at /auth/login


3. Prose Clarity (Strunk's Rules)

Apply when writing prose for humans (docs, commits, PRs, errors).

Grammar Essentials

  1. Form possessive singular by adding 's
  2. Use comma after each term in series except last
  3. Don't join independent clauses by comma (use semicolon or period)
  4. Participial phrase at beginning refers to grammatical subject

Composition Essentials

  1. One paragraph per topic
  2. Begin paragraph with topic sentence
  3. Express coordinate ideas in similar form
  4. Keep related words together
  5. Place emphatic words at end of sentence

Limited Context Strategy

When context is tight: write draft, dispatch subagent with draft + these rules, have subagent copyedit and return revision.

Core Principles

Omit needless words:

WordyConcise
the question as to whetherwhether
there is no doubt but thatno doubt
he is a man whohe
the reason why is thatbecause

Use active voice:

PassiveActive
The file was deleted by the userThe user deleted the file
Errors are logged by the systemThe system logs errors

Positive form over negative:

NegativePositive
did not rememberforgot
not importanttrifling
not honestdishonest

Specific over vague:

VagueSpecific
A period of unfavorable weather set inIt rained every day for a week
The data was processedThe server parsed 10,000 records

Technical Writing

# Commit: Bad
Made some changes to fix the bug that was causing issues

# Commit: Good
Fix null pointer in user authentication

# Error: Bad
An error occurred while processing your request

# Error: Good
Database connection failed: timeout after 30s

# Doc: Bad
This function is used for the purpose of validating user input

# Doc: Good
Validates user input

Editing Checklist

  • Unnecessary words (especially "that", "very", "really", "just")
  • Passive voice -> convert to active
  • Negative statements -> make positive
  • Vague language -> make specific
  • Long sentences -> break up or simplify

4. TOON Format (Data Serialization)

TOON replaces JSON/YAML/XML data serialization when sending to LLMs. ~40% fewer tokens.

Convert to TOON: JSON, YAML, XML (data objects/arrays only) Keep as-is: Markdown, plain text, code files, CSV

Precedence note: TOON converts the *data format structure* (braces, quotes, colons). The "Never Compress" rules protect *values* inside data (API keys, URLs, version numbers). Both apply: convert structure to TOON, but preserve exact values.

JSON:

{"users":[{"id":1,"name":"John","role":"admin"},{"id":2,"name":"Jane","role":"user"}]}

TOON:

users[2]{id,name,role}:
  1,John,admin
  2,Jane,user

See: .claude/skills/document-skills/toon/SKILL.md


Never Compress

See references/never_compress.md for full list:

  • Auth tokens, API keys, credentials, secrets
  • Error stack traces (keep full)
  • Code blocks, inline code, regex
  • URLs, UUIDs, version numbers
  • SQL queries, shell commands
  • JSON keys, config values, date formats
  • Legal text, mathematical formulas

Abbreviations

fn=function  ret=return  str=string  num=number
bool=boolean arr=array   obj=object  param=parameter
config=configuration     env=environment
auth=authentication      authz=authorization
db=database  repo=repository  dir=directory
req=required opt=optional def=default
max=maximum  min=minimum  ex=example
impl=implementation      docs=documentation
app=application          info=information

Symbols

-> = returns/produces    & = and
|  = or                  w/ = with
w/o = without            ~ = approximately
=> = therefore           bc = because
Y  = yes                 N  = no
-  = none/null

Output Format

## Compressed

[Content]

---
Original: X tokens | Compressed: Y tokens | Saved: Z%

Scripts

# Compress text
python scripts/compress.py input.md > compressed.md
python scripts/compress.py input.md --stats
python scripts/compress.py --level 2 < input.md

# Count tokens
python scripts/count_tokens.py document.md

# Compress prompt
python scripts/compress_prompt.py "your prompt text"
python scripts/compress_prompt.py --file prompt.txt --level heavy

Integration

Called by: brainstorm (Phase 5 docs), any skill producing documentation Pairs with: document-skills/toon (data serialization)

平台分布

Codex

34.73%
按下载量换算107

Claude

29.42%
按下载量换算91

Cursor

19.22%
按下载量换算59

Gemini CLI

10.24%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/georgekhananaev/claude-skills-vault --skill token-optimizer 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills