everything-claude-code-zh is a Chinese translation of a collection of configurations for Claude Code and other AI coding agents. It provides agents, skills, hooks, commands, rules, and MCP configurations intended to support development workflows such as memory persistence, security scanning, evaluation, and research-first work. The catalogue includes commands, skills, agents, instructions, and a plugin from this configuration set.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/xu-xiang/everything-claude-code-zh/refactor-cleangit clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zhWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/xu-xiang/everything-claude-code-zh/refactor-clean)<a href="https://agentmods.dev/commands/xu-xiang/everything-claude-code-zh/refactor-clean"><img src="https://agentmods.dev/badge/commands/xu-xiang/everything-claude-code-zh/refactor-clean.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00016 | $0.00708 |
| Opus 5 | $0.00008 | $0.00354 |
| Sonnet 5 | $0.00003 | $0.00142 |
| Haiku 4.5 | $0.00002 | $0.00071 |
Grade A, and why
refactor-clean scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
重构清理 (Refactor Clean) 命令
分析并清理代码库:$ARGUMENTS
你的任务 (Your Task)
- 使用分析工具检测死代码 (Dead code)
- 识别重复项与合并机会
- 安全删除未使用的代码并记录文档
- 验证没有功能被破坏
检测阶段 (Detection Phase)
运行分析工具
# 查找未使用的导出 (exports)
npx knip
# 查找未使用的依赖项 (dependencies)
npx depcheck
# 查找未使用的 TypeScript 导出
npx ts-prune
手动检查
- 未使用的函数(无调用方)
- 未使用的变量
- 未使用的导入 (imports)
- 被注释掉的代码
- 不可达代码 (Unreachable code)
- 未使用的 CSS 类
删除阶段 (Removal Phase)
删除前准备
- 搜索用法 - 使用 grep、查找引用 (find references)
- 检查导出 - 可能被外部使用
- 验证测试 - 确保没有测试依赖它
- 记录删除 - git 提交信息 (commit message)
安全删除顺序
- 首先删除未使用的导入 (imports)
- 删除未使用的私有函数
- 删除未使用的导出函数
- 删除未使用的类型/接口 (types/interfaces)
- 删除未使用的文件
合并阶段 (Consolidation Phase)
识别重复项
- 具有细微差异的相似函数
- 复制粘贴的代码块
- 重复的模式 (patterns)
合并策略
- 提取工具函数 (Utility function) - 针对重复逻辑
- 创建基类 (Base class) - 针对相似的类
- 使用高阶函数 (Higher-order functions) - 针对重复模式
- 创建共享常量 - 针对魔术值 (magic values)
验证 (Verification)
清理完成后:
npm run build- 成功构建npm test- 所有测试通过npm run lint- 无新增 lint 错误- 手动冒烟测试 (Smoke test) - 功能正常运行
报告格式 (Report Format)
死代码分析报告 (Dead Code Analysis)
==================
已删除:
- file.ts: functionName (未使用的导出)
- utils.ts: helperFunction (无调用方)
已合并:
- formatDate() 和 formatDateTime() → dateUtils.format()
剩余项(需手动审查):
- oldComponent.tsx: 可能未使用,需向团队确认
注意 (CAUTION):删除前务必验证。如有疑问,请询问或添加 // TODO: verify usage 注释。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 103 lines · 16 tokens per session scan A 53a6a16dde2e
refactor-clean is a command published in the GitHub repository xu-xiang/everything-claude-code-zh (1,929 stars, last pushed 6mo ago), licensed MIT. It adds 16 tokens to every session and 708 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
awesome-chatgpt
Search awesome-ChatGPT-repositories for open-source GitHub repositories related to ChatGPT and LLMs.
test
Generate comprehensive tests.
commit
智能生成 Git 提交信息并提交.
init
Scaffold a new MindBase project (v2 layout). Usage: /mb:init [template] [-- mission ...].
pr
Handle the full workflow from current branch state to an open, CI-monitored pull request.
doctor.es
Diagnostica problemas de inferencia LLM en Mac: asiai doctor verifica el estado de los motores, conflictos de puertos, carga de modelos y estado de la GPU.