Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问clear审计提醒

test-generator测试发生器

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

388

周安装

16

GitHub Stars

26

下载量

127
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:test-generator(测试发生器)
来源仓库:https://github.com/curiouslearner/devkit
仓库路径:skills/test-generator
安装命令:
npx skills add https://github.com/curiouslearner/devkit --skill test-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/curiouslearner/devkit --skill test-generator

简介

用于辅助测试设计,根据现有代码生成单元测试、边界用例与异常场景,覆盖主要功能路径。

  • 它识别项目所用框架(如 Jest、pytest),自动生成夹具数据、模拟依赖与断言语句,减少手工编写量。
  • 适用于加速 TDD 流程、提升回归测试效率与保障核心逻辑稳定性,尤其适合复杂业务模块。
  • 使用时需确认测试框架配置正确,避免因环境差异导致执行失败;输出包含运行命令与覆盖率预估。
  • 安装前需确保测试目录可写,并建议将生成文件纳入版本控制以跟踪演进;涉及浏览器或外部服务时应使用 mock 替代。

SKILL.md

Test Generator Skill

Generate unit tests based on existing code patterns and testing frameworks.

Instructions

You are a test generation expert. When invoked:

  1. Analyze Code: Examine the target file/function to understand:

- Function signatures and return types - Input/output patterns - Edge cases and error handling - Dependencies and side effects

  1. Detect Testing Framework: Identify the project's testing setup:

- Jest, Mocha, Vitest (JavaScript/TypeScript) - pytest, unittest (Python) - Go testing, Testify (Go) - JUnit, TestNG (Java) - RSpec, Minitest (Ruby)

  1. Generate Tests: Create comprehensive tests covering:

- Happy path scenarios - Edge cases (null, undefined, empty, boundary values) - Error conditions - Mock external dependencies - Async behavior (if applicable)

  1. Follow Patterns: Match existing test conventions in the project:

- File naming (*.test.js, test.go, test.py) - Directory structure - Assertion style - Setup/teardown patterns

Test Coverage Goals

  • Aim for 80%+ code coverage
  • Test all public methods/functions
  • Test error handling paths
  • Test boundary conditions
  • Include integration tests where appropriate

Usage Examples

@test-generator UserService.js
@test-generator src/utils/parser.py
@test-generator --coverage
@test-generator --watch

Best Practices

  • Use descriptive test names (describe what is being tested)
  • One assertion per test when possible
  • Use arrange-act-assert (AAA) pattern
  • Mock external dependencies
  • Keep tests independent and isolated
  • Include both positive and negative test cases
  • Add comments for complex test scenarios

Test Structure

describe('FunctionName', () => {
  it('should handle valid input correctly', () => {
    // Arrange
    // Act
    // Assert
  });

  it('should throw error for invalid input', () => {
    // Test error cases
  });

  it('should handle edge cases', () => {
    // Test boundaries
  });
});

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

26.8%
按下载量换算34

Antigravity

23.42%
按下载量换算30

Claude Code

16.39%
按下载量换算21

Gemini CLI

14.19%
按下载量换算18

windsurf

8.37%
按下载量换算11

github-copilot

3.5%
按下载量换算4

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills