Agent skill

Test Creator

by shenjingnan in shenjingnan/xiaozhi-client

“测试创建技能,用于生成符合项目标准的测试用例”

— description from SKILL.md by shenjingnan
MITAuto-check passedDevelopment

Install Test Creator

skills CLI
$ npx skills add shenjingnan/xiaozhi-client --skill test-creator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shenjingnan/xiaozhi-client test-creator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shenjingnan/xiaozhi-client.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/test-creator .claude/skills/test-creator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-creator
GitHub stars
341
Token cost
~634 tokens
SKILL.md length
122 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
MIT

At a glance

  • Works in 4 steps: 分析测试需求 - 确定测试范围、场景和 Mock 策略 → 生成测试文件 - 创建符合项目标准的完整测试文件 → 确保覆盖率 - 满足 80% 覆盖率要求 → …
  • SKILL.md covers 我的能力, 使用方式, 支持的测试类型 and 测试文件结构, plus 5 more sections
  • Calls pnpm

About this skill

Test Creator is a skill in shenjingnan/xiaozhi-client (341 stars). Its SKILL.md is about 634 tokens. Licence: MIT.

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. 分析测试需求 - 确定测试范围、场景和 Mock 策略
  2. 生成测试文件 - 创建符合项目标准的完整测试文件
  3. 确保覆盖率 - 满足 80% 覆盖率要求
  4. 执行质量检查 - 验证测试代码质量

What it can do on your machine

Read from SKILL.md and the folder at commit fe3c382. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Creator loads about 634 tokens when it runs. Until then it costs about 9 tokens; SKILL.md has 122 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~9
When it runs · the whole SKILL.md, loaded when a task matches
~634

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from shenjingnan/xiaozhi-client at commit fe3c382, republished under its MIT licence (© shenjingnan). 122 words, ~634 tokens.

Download SKILL.mdSave it as .claude/skills/test-creator/SKILL.md (or your agent's skills folder).
name
test-creator
description
测试创建技能,用于生成符合项目标准的测试用例

测试创建技能

我是一个测试创建专家,专门为 xiaozhi-client 项目生成符合标准的测试用例。

我的能力

当你需要创建测试用例时,我会:

  1. 分析测试需求 - 确定测试范围、场景和 Mock 策略
  2. 生成测试文件 - 创建符合项目标准的完整测试文件
  3. 确保覆盖率 - 满足 80% 覆盖率要求
  4. 执行质量检查 - 验证测试代码质量

使用方式

使用格式:/test-create [测试类型] [目标文件或模块]

示例:

  • /test-create mcp-tool "core/unified-server"
  • /test-create cli-command "cli/commands/start"
  • /test-create transport "transports/websocket-adapter"
  • /test-create utility "utils/config-parser"
  • /test-create type "types/xiaozhi-config"
  • /test-create service "managers/connection-manager"

支持的测试类型

mcp-tool - MCP 工具测试
  • 测试重点:参数验证、API 调用、设备查找、错误处理
  • Mock 对象:外部服务、设备状态数据
service - 服务类测试
  • 测试重点:业务逻辑、数据转换、异常处理
  • Mock 对象:外部 API、数据库连接
utility - 工具函数测试
  • 测试重点:输入输出、边界值、类型安全
  • Mock 对象:通常无需 Mock
type - 类型定义测试
  • 测试重点:类型构造函数、类型守卫、错误类型
  • Mock 对象:根据具体需求定
cli-command - CLI 命令测试
  • 测试重点:参数解析、配置加载、错误输出
  • Mock 对象:process.argv、console.log、文件系统
transport - 传输层适配器测试
  • 测试重点:连接建立、消息收发、错误处理、重连
  • Mock 对象:WebSocket、HTTP 服务器

测试文件结构

typescript
import { describe, expect, it, beforeEach, afterEach, vi } from "vitest";
// 导入要测试的模块(使用项目路径别名)
import { TargetClass, TargetFunction } from "@/module/target-module";
// 导入类型定义
import type { TargetType } from "@/module/target-module";

describe("测试描述", () => {
  beforeEach(() => {
    // 测试前的准备工作
  });

  afterEach(() => {
    // 测试后的清理工作
    vi.clearAllMocks();
  });

  describe("功能分组", () => {
    it("应该正确处理基本场景", async () => {
      // 基础功能测试
    });

    it("应该正确处理边界条件", async () => {
      // 边界条件测试
    });

    it("应该正确处理错误情况", async () => {
      // 错误处理测试
    });
  });
});

测试覆盖要求

基于 xiaozhi-client 项目覆盖率目标(80% 分支、函数、行、语句):

必须覆盖的场景
  • 正常流程:所有主要功能路径
  • 边界条件:最小值、最大值、空值、null/undefined
  • 错误处理:所有异常分支和错误码
  • 异步操作:Promise、async/await 的各种状态

测试数据设计

  • 有效数据:符合预期的正常输入
  • 无效数据:各种格式错误的输入
  • 边界数据:临界值和极值
  • 特殊数据:null、undefined、空字符串、空数组

测试执行命令

bash
# 运行所有测试
pnpm test

# 运行特定测试文件
pnpm test src/server/{module}/{target}.test.ts

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

质量保证检查

bash
pnpm typecheck      # TypeScript类型检查
pnpm lint            # 代码规范和格式检查
pnpm spellcheck     # 拼写检查
pnpm check:all       # 运行所有质量检查

测试最佳实践

测试命名
  • 使用描述性的测试名称
  • 采用中文描述
  • 包含测试的具体场景和预期结果
测试结构
  • 使用 AAA 模式:Arrange(准备)、Act(执行)、Assert(断言)
  • 每个测试用例只验证一个行为
  • 使用有意义的测试数据
Mock 使用
  • 只 Mock 外部依赖,不测试实现细节
  • Mock 行为应该真实且一致
  • 在测试后清理 Mock 状态

© shenjingnan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/test-creator of shenjingnan/xiaozhi-client.

Open the folder on GitHubat commit fe3c382

Compare with similar skills

Test Creator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Creator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Creator this skillshenjingnan/xiaozhi-client341—~634Automated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from shenjingnan/xiaozhi-client

All 16 skills in this repo
  • E2E Coverage Analyzer

    shenjingnan/xiaozhi-client

    分析当前分支 git 改动,检查 e2e 测试用例覆盖情况,并可补充缺失的测试用例. An agent skill from shenjingnan/xiaozhi-client.

    341 GitHub stars~954 tokensUpdated 1 mo ago
    Auto-check passed
  • Fix Comment

    shenjingnan/xiaozhi-client

    GitHub 评论修复技能,用于获取 PR 的 Copilot 评论并分析修复问题. An agent skill from shenjingnan/xiaozhi-client.

    341 GitHub stars~873 tokensUpdated 1 mo ago
    Auto-check passed
  • API Docs

    shenjingnan/xiaozhi-client

    文档自动生成

    341 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • CI Validator

    shenjingnan/xiaozhi-client

    CI检查验证和质量保障

    341 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Commit

    shenjingnan/xiaozhi-client

    生成代码评审友好的 commit 信息

    341 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Dev Workflow Checker

    shenjingnan/xiaozhi-client

    开发流程检查技能,确保代码修改后执行必要的质量检查

    341 GitHub stars~464 tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Test Creator

How do I install Test Creator in Claude Code?

Run `npx skills add shenjingnan/xiaozhi-client --skill test-creator -a claude-code`. Or copy the skill folder (.agents/skills/test-creator in shenjingnan/xiaozhi-client) into .claude/skills/test-creator in your project. Claude Code loads it when a task matches its description.

How do I install Test Creator in Codex?

Run `npx skills add shenjingnan/xiaozhi-client --skill test-creator -a codex`. Or copy the skill folder (.agents/skills/test-creator in shenjingnan/xiaozhi-client) into .agents/skills/test-creator in your project. Codex loads it when a task matches its description.

Can I use Test Creator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shenjingnan/xiaozhi-client --skill test-creator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-creator, .gemini/skills/test-creator, .github/skills/test-creator and .opencode/skills/test-creator in your project.

What does Test Creator need to run?

Going by SKILL.md and its folder, Test Creator needs the command-line tools its instructions call (pnpm).

Does Test Creator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test Creator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test Creator use?

Test Creator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Creator use?

About 634 tokens (SKILL.md is roughly 2.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Creator?

Skills that share tags, products or a category with Test Creator: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Creator?

shenjingnan (a GitHub user) maintains it in shenjingnan/xiaozhi-client, which has 341 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on September 3, 2026.

Source: shenjingnan/xiaozhi-client on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.