Install
$ agentstack add skill-smwswk-xiaoming-agent-skills-token-optimization ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Token Optimization
Use this skill to keep long or material-heavy work cheap and controlled without hiding uncertainty.
Core Rule
Do not make the model reread the world every turn. Let tools process bulk material, then bring only the evidence, summaries, and decisions that need model judgment into context.
Routing Policy
When the task is about saving tokens, controlling context, or keeping long work cheap, route by the real bottleneck:
| Situation | Default route | Why | |---|---|---| | General large files, logs, transcripts, PDFs, images, repo exploration, or long tasks | token-optimization | Inspect lists and summaries first, then read only the evidence needed for judgment. | | Need a global compression layer for Claude, Codex, Cursor, Aider, Copilot, or an OpenAI-compatible client | headroom | Headroom can run as proxy, MCP server, or wrapper. Do not run durable headroom init, headroom wrap, or headroom unwrap without explicit user confirmation. | | Memory index is bloated, duplicate, stale, or has dead links | memory-thin | Clean MEMORY.md indexes and dead links without deleting underlying memory files. | | Current web facts, URL extraction, or multi-query search | anysearch | Use direct search/extract commands and vertical/batch search instead of pulling broad raw result pools into context. | | Batch content ingestion across B站, 小宇宙, 小红书, 公众号, 知乎, AI HOT, or reminders links | content workflow or quantum-speed-reading | Download/extract/ASR to files first, then work from summary.md, full.txt, and review queues. | | Single content item that needs the full summary-to-insight pipeline | Platform ingestion skill, then 全自动总结迭代 | Finish extraction/ASR first; use 全自动总结迭代 only as the insight and review hook after a summary exists. | | AI news lookup | external AI-news provider | Use server-side keyword and time-window filtering; do not fetch a large pool and grep locally. | | Lark/Feishu mail verification or operation checks | lark-mail with --html=false when possible | Avoid fetching HTML bodies when only status or metadata is needed. | | Need quota visibility in the final response | quota-footer | Append the short quota footer only; do not expand raw usage details unless requested or near limit. |
Default Workflow
- Clarify the goal and minimum evidence needed.
- Inspect directory/file lists before opening content.
- Prefer summaries, indexes, manifests, stats, and short error reports before full text.
- For logs, read extracted errors, warnings, failing tests, and tail sections before complete logs.
- For images/PDFs, use previews, contact sheets, or cropped regions before high-resolution pages.
- For mechanical bulk work, use scripts/tools and read their concise report.
- For long tasks, end each phase with a 1-2 KB handoff card and suggest a new thread when context becomes stale.
Handoff Card
Use this format when a task changes phase or the thread gets long:
## 当前目标
## 已确认决定
## 关键材料
## 已完成
## 下一步
## 风险和注意事项
User-Facing Prompt Pattern
When useful, ask or restate the task in this compact structure:
目标:
材料:
你先做:
不要做:
输出格式:
Reporting
For token-sensitive tasks, briefly state:
- what was actually read;
- what was intentionally not read;
- the smallest next material needed, if any.
Full Reference
The original installed rule document is at references/token-optimization-rules.md. Read it only when the user asks for the full rules or when the compact workflow above is insufficient.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: smwswk
- Source: smwswk/xiaoming-agent-skills
- License: MIT
- Homepage: https://smwswk.github.io/skill-store/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.