rtk-optimizer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRTK Optimizer Skill
RTK优化器Skill
Purpose: Automatically suggest RTK wrappers for high-verbosity commands to reduce token consumption.
用途:自动为高冗余度命令推荐RTK包装器,以减少Token消耗。
How It Works
工作原理
- Detect high-verbosity commands in user requests
- Suggest RTK wrapper if applicable
- Execute with RTK when user confirms
- Track savings over session
- 检测用户请求中的高冗余度命令
- 若适用则推荐RTK包装器
- 用户确认后使用RTK执行
- 在会话期间跟踪Token节省量
Supported Commands
支持的命令
Git (>70% reduction)
Git(缩减率>70%)
- →
git log(92.3% reduction)rtk git log - →
git status(76.0% reduction)rtk git status - →
find(76.3% reduction)rtk find
- →
git log(缩减率92.3%)rtk git log - →
git status(缩减率76.0%)rtk git status - →
find(缩减率76.3%)rtk find
Medium-Value (50-70% reduction)
中等缩减率(50-70%)
- →
git diff(55.9% reduction)rtk git diff - →
cat <large-file>(62.5% reduction)rtk read <file>
- →
git diff(缩减率55.9%)rtk git diff - →
cat <large-file>(缩减率62.5%)rtk read <file>
JS/TS Stack (70-90% reduction)
JS/TS技术栈(70-90%缩减率)
- →
pnpm list(82% reduction)rtk pnpm list - /
pnpm test→vitest run(90% reduction)rtk vitest run
- →
pnpm list(缩减率82%)rtk pnpm list - /
pnpm test→vitest run(缩减率90%)rtk vitest run
Rust Toolchain (80-90% reduction)
Rust工具链(80-90%缩减率)
- →
cargo test(90% reduction)rtk cargo test - →
cargo build(80% reduction)rtk cargo build - →
cargo clippy(80% reduction)rtk cargo clippy
- →
cargo test(缩减率90%)rtk cargo test - →
cargo build(缩减率80%)rtk cargo build - →
cargo clippy(缩减率80%)rtk cargo clippy
Python & Go (90% reduction)
Python & Go(90%缩减率)
- →
pytest(90% reduction)rtk python pytest - →
go test(90% reduction)rtk go test
- →
pytest(缩减率90%)rtk python pytest - →
go test(缩减率90%)rtk go test
GitHub CLI (79-87% reduction)
GitHub CLI(79-87%缩减率)
- →
gh pr view(87% reduction)rtk gh pr view - →
gh pr checks(79% reduction)rtk gh pr checks
- →
gh pr view(缩减率87%)rtk gh pr view - →
gh pr checks(缩减率79%)rtk gh pr checks
File Operations
文件操作
- →
ls(condensed output)rtk ls - →
grep(filtered output)rtk grep
- →
ls(精简输出)rtk ls - →
grep(过滤后输出)rtk grep
Activation Examples
激活示例
User: "Show me the git history"
Skill: Detects → Suggests → Explains 92.3% token savings
git logrtk git logUser: "Find all markdown files"
Skill: Detects → Suggests → Explains 76.3% savings
findrtk find "*.md" .用户:"显示Git提交历史"
Skill:检测到 → 推荐 → 说明可节省92.3%的Token
git logrtk git log用户:"查找所有Markdown文件"
Skill:检测到 → 推荐 → 说明可节省76.3%的Token
findrtk find "*.md" .Installation Check
安装检查
Before first use, verify RTK is installed:
bash
rtk --version # Should output: rtk 0.16.0+If not installed:
bash
undefined首次使用前,请确认已安装RTK:
bash
rtk --version # 应输出:rtk 0.16.0+若未安装:
bash
undefinedHomebrew (macOS/Linux)
Homebrew(macOS/Linux)
brew install rtk-ai/tap/rtk
brew install rtk-ai/tap/rtk
Cargo (all platforms)
Cargo(全平台)
cargo install rtk
undefinedcargo install rtk
undefinedUsage Pattern
使用模式
markdown
undefinedmarkdown
undefinedWhen user requests high-verbosity command:
当用户请求高冗余度命令时:
- Acknowledge request
- Suggest RTK optimization:
"I'll use to reduce token usage by ~92%"
rtk git log - Execute RTK command
- Track savings (optional): "Saved ~13K tokens (baseline: 14K, RTK: 1K)"
undefined- 确认用户请求
- 推荐RTK优化方案:
"我将使用来减少约92%的Token消耗"
rtk git log - 执行RTK命令
- 跟踪节省量(可选): "已节省约13K Token(基准值:14K,RTK后:1K)"
undefinedSession Tracking
会话跟踪
Optional: Track cumulative savings across session:
bash
undefined可选:跟踪会话期间的累计Token节省量:
bash
undefinedAt session end
会话结束时
rtk gain # Shows total token savings for session (SQLite-backed)
undefinedrtk gain # 显示会话期间的总Token节省量(基于SQLite存储)
undefinedEdge Cases
边缘情况
- Small outputs (<100 chars): Skip RTK (overhead not worth it)
- Already using Claude tools: Grep/Read tools are already optimized
- Multiple commands: Batch with RTK wrapper once, not per command
- 小输出内容(<100字符):跳过RTK(开销得不偿失)
- 已使用Claude工具:Grep/Read工具已做优化
- 多条命令:一次性用RTK包装器批量处理,而非逐个命令处理
Configuration
配置
Enable via CLAUDE.md:
markdown
undefined通过CLAUDE.md启用:
markdown
undefinedToken Optimization
Token优化
Use RTK (Rust Token Killer) for high-verbosity commands:
- git operations (log, status, diff)
- package managers (pnpm, npm)
- build tools (cargo, go)
- test frameworks (vitest, pytest)
- file finding and reading
undefined对以下高冗余度命令使用RTK(Rust Token Killer):
- Git操作(log、status、diff)
- 包管理器(pnpm、npm)
- 构建工具(cargo、go)
- 测试框架(vitest、pytest)
- 文件查找与读取
undefinedMetrics (Verified)
验证指标
Based on real-world testing:
- : 13,994 chars → 1,076 chars (92.3% reduction)
git log - : 100 chars → 24 chars (76.0% reduction)
git status - : 780 chars → 185 chars (76.3% reduction)
find - : 15,815 chars → 6,982 chars (55.9% reduction)
git diff - : 163,587 chars → 61,339 chars (62.5% reduction)
read file
Average: 72.6% token reduction
基于真实场景测试:
- :13,994字符 → 1,076字符(缩减率92.3%)
git log - :100字符 → 24字符(缩减率76.0%)
git status - :780字符 → 185字符(缩减率76.3%)
find - :15,815字符 → 6,982字符(缩减率55.9%)
git diff - :163,587字符 → 61,339字符(缩减率62.5%)
read file
平均缩减率:72.6%
Limitations
局限性
- 446 stars on GitHub, actively maintained (30 releases in 23 days)
- Not suitable for interactive commands
- Rapid development cadence (check for breaking changes)
- GitHub上拥有446星,维护活跃(23天内发布30个版本)
- 不适用于交互式命令
- 开发节奏快(需注意破坏性更新)
Recommendation
使用建议
Use RTK for: git workflows, file operations, test frameworks, build tools, package managers
Skip RTK for: small outputs, quick exploration, interactive commands
推荐使用RTK的场景:Git工作流、文件操作、测试框架、构建工具、包管理器
不推荐使用RTK的场景:小输出内容、快速探索、交互式命令
References
参考资料
- RTK GitHub: https://github.com/rtk-ai/rtk
- RTK Website: https://www.rtk-ai.app/
- Evaluation:
docs/resource-evaluations/rtk-evaluation.md - CLAUDE.md template:
examples/claude-md/rtk-optimized.md
- RTK GitHub仓库:https://github.com/rtk-ai/rtk
- RTK官网:https://www.rtk-ai.app/
- 评估文档:
docs/resource-evaluations/rtk-evaluation.md - CLAUDE.md模板:
examples/claude-md/rtk-optimized.md