Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

verify-test-cases验证测试用例

Agent Skill

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

总安装

1,576

周安装

65

GitHub Stars

公开资料未说明

下载量

515
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/morphet81/cheat-sheets --skill verify-test-cases

简介

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

  • 适合编写单元测试、端到端测试或根据失败日志定位问题。
  • 使用时应确认项目测试框架、运行命令和夹具数据,避免为通过测试而破坏真实逻辑。
  • 安装命令:npx skills add https://github.com/morphet81/cheat-sheets --skill verify-test-cases
  • 涉及浏览器或外部服务时,应区分本地模拟、测试环境与生产环境。

SKILL.md

Verify the quality and correctness of test cases in all test files modified since branching out from the base branch.

Usage:

  • /verify-test-cases - Verify test files modified since branching from base branch

Instructions:

  1. Determine the base branch:

- Check if a .agent file exists in the current directory - If it exists, read it and look for a baseBranch=<value> line to extract the base branch - If no .agent file or no baseBranch key, default to main

  1. Identify modified test files since branching:

- Run git diff --name-only <base-branch>...HEAD to get all files modified since branching from the base branch - Filter for test files using common patterns: - *.test.*, *.spec.* (JS/TS) - test_*.py, *_test.py (Python) - *_test.go (Go) - *_test.rs, files under tests/ (Rust) - Files under __tests__/, test/, tests/, spec/ directories - If no test files were modified, inform the user and STOP

  1. Analyze test files using a team: Spawn parallel agents to analyze test files concurrently. Each agent reviews one or more test files independently. a) Determine team size based on the number of test files: b) If spawning a team: c) If analyzing directly (1–2 files):

- 1–2 test files → analyze directly (no team needed) - 3–5 test files → spawn 2 reviewer agents - 6+ test files → spawn 3 reviewer agents - Use TeamCreate with name verify-tests - Use TaskCreate to create one task per reviewer: "Review test files: <file1>, <file2>,..." - Divide test files across reviewers, grouping files that test the same source module together when possible - Spawn reviewers using the Task tool (subagent_type: general-purpose) with run_in_background: true and the team name - Each reviewer receives: - The list of test files to analyze - Instructions to also read the source files being tested for context - The full verification checklist (steps 4 and 5 below) - Reviewers must mark their tasks as completed and message the team lead with findings - Wait for all reviewers to finish, then aggregate results - Read and analyze the test file(s) yourself following steps 4 and 5

  1. Verify test cases make sense: For each test file, check that: a. Test descriptions match behavior: b. Assertions are meaningful: c. Test setup is correct: d. Tests are independent: e. Tests match the source code:

- Test names/descriptions accurately reflect what is being tested - The test body actually tests what the name says it does - Tests have actual assertions (not just running code without checking results) - Assertions verify the right thing (not just toBeTruthy() on everything) - Edge cases and boundary conditions are covered where appropriate - Mocks and stubs make sense for what's being tested - Test fixtures and data are realistic - Setup/teardown properly initializes and cleans up state - Tests don't rely on execution order - Shared state isn't leaking between tests - Tests cover the actual function signatures and behavior - Tests aren't testing stale or non-existent APIs

  1. Check for duplications: For each test file and across all modified test files: a. Exact duplicates: b. Logical duplicates: c. Redundant assertions:

- Tests with identical or near-identical test bodies - Copy-pasted tests that weren't modified - Different tests that verify the exact same behavior - Tests that overlap significantly in what they cover - Multiple assertions in separate tests that check the same thing - Tests that are strict subsets of other tests

  1. Report findings: If a team was used, aggregate all reviewer findings and clean up the team (send shutdown_request to each reviewer, then TeamDelete). Format the output as follows:
## Test Verification Report

### Files Analyzed
- `path/to/file.test.ts` (N tests)
- `path/to/other.spec.js` (N tests)

### Issues Found

#### Nonsensical / Incorrect Tests
- **file.test.ts:42** `"should handle empty input"` - Test passes a non-empty string, contradicting its description
- **file.test.ts:67** `"should return user"` - No assertion on the return value

#### Duplicate Tests
- **file.test.ts:30** and **file.test.ts:55** - Both test the same "valid email" scenario with identical logic
- **other.spec.js:12** and **other.spec.js:40** - Logically equivalent: both verify default config values

#### Missing Coverage
- `createUser()` has no test for the error/rejection path
- Edge case: empty array input is not tested for `processItems()`

### Summary
- Total test files analyzed: N
- Total test cases reviewed: N
- Issues found: N
- Duplicates found: N
- Verdict: PASS / NEEDS ATTENTION
  1. Coverage gate (mandatory after test-case changes are final):

- Wait for the user to explicitly confirm that test-case work is done: either they approve your proposed edits (after you apply them), they confirm they applied changes themselves, or they confirm the report required no test changes and they are ready to proceed. - Choose the coverage command (repository root). If there is no package.json, tell the user coverage cannot be run for this workspace and STOP after the report. - Node.js projects: Read package.json scripts and dependencies (dependencies / devDependencies / peerDependencies): 1. If a test:coverage script exists, use npm run test:coverage. 2. Otherwise, if the project uses Vitest (e.g. vitest in deps or a test script invoking vitest), run npx vitest run --coverage. 3. Otherwise, if the project uses Jest (e.g. jest in deps or a test script invoking jest), run npx jest --coverage. 4. Otherwise, if another script clearly runs tests with coverage (e.g. coverage, test -- --coverage), run that via npm run <script>. 5. If none of the above apply, tell the user no coverage command could be determined and STOP after the report. - Run the chosen command. If it fails (non-zero exit, failing tests, or coverage thresholds not met per the project’s configuration), fix the tests (or adjust tests only when production code is correct and the test is wrong). Re-run the same command. Iterate until it exits successfully. - Do not treat the verification report as complete until this step succeeds.

  1. Handle edge cases:

- If there are no commits on the branch compared to the base branch, inform the user and STOP - If modified files include both test and source files, use the source files for context but only report on the test files - If a test file imports from files you can't find, note it but continue analysis - For very large test files (>500 lines), focus on the changed sections using git diff for those specific files

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.8%
按下载量换算184

Claude

32.24%
按下载量换算166

Cursor

18.1%
按下载量换算93

Gemini CLI

9.15%
按下载量换算47

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/morphet81/cheat-sheets --skill verify-test-cases 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills