xiaozhi-client: Skill for Claude Code

.agents/skills/test-cleaner/SKILL.md

test-cleaner is a skill for Claude Code, Codex from shenjingnan/xiaozhi-client. It costs 25 tokens per session (1,192 once invoked), scanned A, original, MIT.

A testing-review workflow that finds tests which are outside their module's responsibility, duplicated elsewhere, low-value, or too dependent on mocked details.

In plain words
What is it for?
Use it to scan test files, classify unit, integration, and end-to-end tests, produce a cleanup report, and remove approved tests.
Why use it?
It helps reduce tests that add little confidence or make failures harder to understand, while requiring confirmation before deletion.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is shenjingnan/xiaozhi-client's own configuration. It tells Claude Code and Codex how to work on xiaozhi-client itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything xiaozhi-client configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shenjingnan/xiaozhi-client. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/.agents/skills/test-cleaner/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/shenjingnan/xiaozhi-client

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for test-cleaner

README.md
[![agentmods](https://agentmods.dev/badge/skills/shenjingnan/xiaozhi-client/test-cleaner/github.svg)](https://agentmods.dev/skills/shenjingnan/xiaozhi-client/test-cleaner)
Your own site
<a href="https://agentmods.dev/skills/shenjingnan/xiaozhi-client/test-cleaner"><img src="https://agentmods.dev/badge/skills/shenjingnan/xiaozhi-client/test-cleaner/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-cleaner

Your own site · 80×15
<a href="https://agentmods.dev/skills/shenjingnan/xiaozhi-client/test-cleaner"><img src="https://agentmods.dev/badge/skills/shenjingnan/xiaozhi-client/test-cleaner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,192 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.01192
Opus 5 $0.00013 $0.00596
Sonnet 5 $0.00005 $0.00238
Haiku 4.5 $0.00003 $0.00119

Measured 10d ago against content hash 724a82497fff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

test-cleaner 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 10d 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.

.agents/skills/test-cleaner/SKILL.md · 163 lines

How it starts

The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.

测试清理技能

我是一个测试清理专家,专门分析并清理超出测试职责范围或低价值的测试用例。

我的能力

当你需要清理测试用例时,我会:

  1. 分析测试文件 - 扫描并识别问题测试用例
  2. 生成分析报告 - 详细列出问题和建议
  3. 等待用户确认 - 在执行清理前获得明确确认
  4. 执行清理 - 删除问题用例并验证结果

使用方式

使用格式:/test-cleanup [路径]

示例

  • /test-cleanup - 分析整个项目的测试文件
  • /test-cleanup src/server/handlers - 分析特定模块
  • /test-cleanup src/server/handlers/__tests__/mcp-manage.handler.test.ts - 分析特定文件

分析流程

扫描阶段

  1. 识别测试文件:查找目标路径下所有的 *.test.ts 文件
  2. 解析导入关系:提取每个测试文件的导入语句
  3. 分类测试模块:单元测试、集成测试、端到端测试

问题识别

严重问题(应立即删除):

  • 超纲测试:在消费者测试中测试外部依赖的内部实现
    • 判断标准:测试用例验证的是外部依赖的行为而非当前模块的职责

警告问题(建议删除或重构):

  • 重复测试:已在提供者模块中覆盖的单元功能
    • 判断标准:测试用例在依赖模块中已存在类似的覆盖

建议优化(可选改进):

  • 低价值测试:不提供独特价值的测试用例
    • 判断标准:测试失败时无法提供有价值的调试信息

过度 Mock

  • 问题模式:Mock 了不应 Mock 的内部实现细节
    • 判断标准:Mock 破坏了测试的真实性和价值

分析报告格式

# 测试用例清理分析报告

## 分析范围
- 路径: `<指定路径>`
- 测试文件数: X
- 问题用例数: Y

## 严重问题(应删除)
### 文件: src/server/handlers/__tests__/mcp-manage.handler.test.ts
#### 问题: 超纲测试 - 重复测试 TypeFieldNormalizer
- **位置**: 第 45-67 行
- **问题**: 测试了外部依赖中已完整覆盖的单元功能
- **建议**: 删除这些测试用例

## 清理总结
- 可删除测试用例: X 个
- 可优化测试用例: Y 个

执行阶段

用户确认

  1. 展示分析报告
  2. 询问是否确认执行清理
  3. 等待用户确认后才进行修改

清理操作

如果用户确认,执行以下操作:

# 创建备份分支
git checkout -b test-cleanup-backup-$(date +%Y%m%d)

# 删除问题测试
# 根据报告中的位置信息,删除超出范围的测试用例

# 验证测试
pnpm test <指定路径>

# 生成覆盖率报告
pnpm test:coverage

回滚选项

# 如果清理导致问题,可以回滚
git checkout main
git branch -D test-cleanup-backup-$(date +%Y%m%d)

示例分析

超纲测试示例

问题代码:

// ❌ 超纲测试
import { normalizeTypeField } from "@/lib/mcp-core/utils/type-field-normalizer";

describe("MCPManageHandler", () => {
  describe("normalizeTypeField", () => {
    it("应该正确处理 null 类型字段", () => {
      // 这是工具函数的单元测试,不应该在 handler 测试中
    });
  });
});

清理建议:

// ✅ 正确范围
describe("MCPManageHandler", () => {
  describe("handleListTools", () => {
    it("应该正确调用 normalizeTypeField 处理工具定义", () => {
      // 验证 handler 在业务场景中正确使用了外部依赖
    });
  });
});

Read the full file on GitHub · 163 lines

Changes

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.

  1. 10d ago First seen · 163 lines · 25 tokens per session scan A 724a82497fff

Subscribe to this mod's changes

test-cleaner is a skill published in the GitHub repository shenjingnan/xiaozhi-client (338 stars, last pushed 6d ago), licensed MIT. It adds 25 tokens to every session and 1,192 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.

Related

Other skills, from other repositories

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

tika-eval-compare

Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".

apache/tika · 50 tokens

neuron-evaluation-engineer

Create and run AI evaluations with datasets, assertions, and output drivers in Neuron AI. Use this skill whenever the user mentions evaluation, testing AI systems, creating evaluators, dataset-driven testing, assertion-based validation, or wants to measure AI system performance. Also trigger for tasks involving…

neuron-core/neuron-ai · 77 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens

atmos-validation

Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.

cloudposse/atmos · 31 tokens

skill-benchmark

Benchmark AI skill effectiveness by measuring implementation quality against legacy constraints.

HoangNguyen0403/agent-skills-standard · 16 tokens