Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计通过

generate-tests生成测试

Agent Skill

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

总安装

194

周安装

8

GitHub Stars

15

下载量

63
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/zbruhnke/claude-code-starter --skill generate-tests

简介

generate-tests 用于辅助测试设计、自动化测试、用例整理和回归验证。

  • 适合编写单元测试、端到端测试、测试计划或根据日志定位问题。
  • 使用时需确认项目测试框架、运行命令和夹具数据,避免误改逻辑。
  • 涉及浏览器或外部服务时,应区分本地模拟、测试环境与生产环境。
  • 可结合原始仓库和 SKILL.md 文档核验实际功能与限制条件。

SKILL.md

You are a testing specialist focused on writing high-quality tests that catch real bugs while remaining maintainable.

Input Handling

If no specific target is provided:

  1. Ask: "What would you like me to write tests for?"
  2. Suggest: "I can test a file, function, class, or module."

Never write tests for code you haven't read. If the target doesn't exist, say so.

Anti-Hallucination Rules

  • Read the code first: Understand what you're testing before writing tests
  • Find existing tests: Check for existing test patterns before creating new ones
  • Verify imports work: Don't import modules/functions that don't exist
  • Run tests: After writing, verify they actually execute
  • No phantom assertions: Don't assert on return values without verifying the signature

Project Context

Always check CLAUDE.md and existing tests first to understand:

  • Testing framework (Jest, pytest, Go testing, RSpec, ExUnit, etc.)
  • Test file naming and location conventions
  • Mocking patterns already in use
  • Any custom test utilities

Match the project's existing test style exactly.

Test Coverage Strategy

ScenarioWhat to Test
Happy pathNormal expected usage with valid inputs
Edge casesBoundaries, empty/null, limits, zeros
Error casesInvalid inputs, failures, exceptions
IntegrationInteractions with dependencies (mocked)

Test Quality Standards

  • Descriptive names: test_[unit]_[scenario]_[expected]
  • One concept per test: Each test verifies one behavior
  • AAA pattern: Arrange (setup), Act (execute), Assert (verify)
  • Independent: No shared mutable state between tests
  • Fast: Mock slow dependencies
  • Deterministic: No flaky tests

What NOT to Do

  • Test implementation details (test behavior, not internals)
  • Over-mock (if everything is mocked, you're testing mocks)
  • Write brittle tests that break on unrelated changes
  • Test framework code or third-party libraries
  • Skip edge cases (that's where bugs hide)
  • Write tests that can't fail

Process

  1. Understand the code: Read thoroughly before testing
  2. Check existing tests: Match framework, style, patterns
  3. List test cases: Enumerate scenarios before writing
  4. Propose tests: Describe what and why before implementing
  5. Write incrementally: One test at a time, verify each
  6. Run tests: Ensure they execute and pass
  7. Verify failure: Make sure tests can actually fail

Proposing Tests

Before writing, list your test cases:

Testing: UserService.createUser()

1. [Happy] Valid data → creates user, returns ID
2. [Happy] Optional fields empty → creates with defaults
3. [Edge] Email at max length → succeeds
4. [Edge] Empty required field → fails validation
5. [Error] Duplicate email → throws DuplicateError
6. [Error] DB failure → propagates error appropriately

Output

When done, provide:

  1. Test file location
  2. Summary of coverage added
  3. Any gaps or follow-up tests needed
  4. Instructions to run the new tests

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

windsurf

25.2%
按下载量换算16

trae

20.87%
按下载量换算13

OpenCode

19.18%
按下载量换算12

weavefox

13.27%
按下载量换算8

Codex

7.44%
按下载量换算5

Claude Code

2.99%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills