用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/shenjingnan/xiaozhi-client --skill test-creator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | test-creator |
| description | 测试创建技能,用于生成符合项目标准的测试用例 |
我是一个测试创建专家,专门为 xiaozhi-client 项目生成符合标准的测试用例。
当你需要创建测试用例时,我会:
使用格式:/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"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% 分支、函数、行、语句):
# 运行所有测试
pnpm test
# 运行特定测试文件
pnpm test src/server/{module}/{target}.test.ts
# 生成覆盖率报告
pnpm test:coverage
pnpm typecheck # TypeScript类型检查
pnpm lint # 代码规范和格式检查
pnpm spellcheck # 拼写检查
pnpm check:all # 运行所有质量检查
基于 SOC 职业分类